package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.Report;
import com.ruoyi.system.mapper.ReportMapper;
import com.ruoyi.system.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ReportServiceImpl implements ReportService {
    @Autowired
    ReportMapper reportMapper;

    @Override
    public List<Report> selectReportList(Report report) {
        return reportMapper.selectList(report);
    }

    @Override
    public List<Report> selectNeedMeCustomerList(Long keeperId) {
        return reportMapper.selectNeedMeCustomerList(keeperId);
    }

    @Override
    public List<Report> selectNeedMeDeviceList(Long keeperId) {
        return reportMapper.selectNeedMeDeviceList(keeperId);
    }

    @Override
    public List<Report> selectNeedMeDeviceListFinished(Long keeperId) {
        return reportMapper.selectNeedMeDeviceListFinished(keeperId);
    }

    @Override
    public List<Report> selectNotFinishedReportList(Report report) {
        return reportMapper.selectNotFinishedList(report);
    }

    @Override
    public List<Report> selectAll(Report report) {
        return reportMapper.selectAll(report);
    }

    @Override
    public Report selectById(Long id) {
        return reportMapper.selectById(id);
    }

    @Override
    public Boolean createKeep(Report report) {
        return reportMapper.insert(report) == 1;
    }

    @Override
    public Boolean updateReport(Report report) {
        return reportMapper.update(report) == 1;
    }

    @Override
    public Boolean deleteById(Long id) {
        return reportMapper.deleteById(id) == 1;
    }

    @Override
    public Integer selectListCount(String startTime, String endTime, String location) {
        return reportMapper.selectListCount(startTime, endTime, location);
    }
}
